/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ufpe.cin.dsoa.visualvm.gui;

import com.sun.tools.visualvm.application.Application;
import com.sun.tools.visualvm.core.ui.DataSourceView;
import com.sun.tools.visualvm.core.ui.components.DataViewComponent;
import br.ufpe.cin.dsoa.visualvm.facade.PrincipalFacade;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JEditorPane;

import org.openide.util.Utilities;

/**
 *
 * @author rafael.lima
 */
public class PrincipalView extends DataSourceView {
    
    private PrincipalFacade facade;
    
    private DataViewComponent dvc;
    //Make sure there is an image at this location in your project:
    private static final String IMAGE_PATH = "br/ufpe/cin/dsoa/visualvm/img/icon.png"; // NOI18N {

    public PrincipalView(Application app){
        super(app,"DSOA", new ImageIcon(Utilities.loadImage(IMAGE_PATH, true)).getImage(), 60, false);
        this.facade = new PrincipalFacade(app);
    }
    
    @Override
    protected DataViewComponent createComponent() {
       
        
        
        //Data area for master view:
        JEditorPane generalDataArea = new JEditorPane();
        generalDataArea.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
        
        
      
        BindView qew = new BindView(facade);
        CreateView create = new CreateView(facade); 
        //Panel, which we'll reuse in all four of our detail views for this sample:


        //Master view:
        DataViewComponent.MasterView masterView = new DataViewComponent.MasterView("Overview", "Teste 123", generalDataArea);

        //Configuration of master view:
        DataViewComponent.MasterViewConfiguration masterConfiguration = new DataViewComponent.MasterViewConfiguration(false);

        //Add the master view and configuration view to the component:
        dvc = new DataViewComponent(masterView, masterConfiguration);

         dvc.addDetailsView(new DataViewComponent.DetailsView("Service Monitoring", "Configurations on available Monitoring Services", 10, qew, null), DataViewComponent.TOP_LEFT);
        //Add detail views to the component:
       // dvc.addDetailsView(new DataViewComponent.DetailsView("Service Monitoring", "Configurations on available Monitoring Services", 10, asd, null), DataViewComponent.TOP_LEFT);
       // dvc.addDetailsView(new DataViewComponent.DetailsView("Characteristic Overview", null, 20, qwe, null), DataViewComponent.TOP_RIGHT);
      //  dvc.addDetailsView(new DataViewComponent.DetailsView("Category Overview", null, 30, zxc, null), DataViewComponent.BOTTOM_LEFT);
      //  dvc.addDetailsView(new DataViewComponent.DetailsView("Window Overview", null, 40, aaa, null), DataViewComponent.TOP_RIGHT);
      //  dvc.addDetailsView(new DataViewComponent.DetailsView("Dimension Overview", null, 50, bbb, null), DataViewComponent.TOP_RIGHT);
         dvc.addDetailsView(new DataViewComponent.DetailsView("Create Overview", null, 50, create, null), DataViewComponent.TOP_RIGHT); 
         
        return dvc;
    }
    
}
